{extend name="public:base" /}
{block name="content"}
<div class="page-header">
	<h1>
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb2}
		</small>
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$crumbs}
		</small>		
	</h1>
</div>
<div class="row">
	<div class="col-xs-12">	
		<div class="form-horizontal">
			
			{if condition="$Request.param.id"}
			<input name="admin_id" type="hidden" value="{$Request.param.id}" />
			{/if}			
					
			<div class="form-group required">
				<label class="col-sm-2 control-label">用户名：</label>
				<div class="col-sm-10">
					<input  class="form-control" type="text" placeholder="用户名" name="user_name"  value="{$user.user_name|default=''}" />
				</div>
			</div>			
			
			<div class="form-group required">
				<label class="col-sm-2 control-label">密码：</label>
				<div class="col-sm-10">
					<input  class="form-control" type="text" placeholder="密码" name="passwd"  value="888888" />
				</div>
			</div>
									
			<div class="form-group required">
				<label class="col-sm-2 control-label">真实姓名：</label>
				<div class="col-sm-10">
					<input  class="form-control" type="text" placeholder="真实姓名" name="true_name"  value="{$user.true_name|default=''}" />
				</div>
			</div>
			
			<div class="form-group required">
				<label class="col-sm-2 control-label">手机号码：</label>
				<div class="col-sm-10">
					<input  class="form-control" type="text" placeholder="手机号码" name="telephone"  value="{$user.telephone|default=''}" />
				</div>
			</div>
			
			<div class="form-group required">
				<label class="col-sm-2 control-label">用户组：</label>
				<div class="col-sm-10">
					<select class="form-control" name="group_id">
						{volist name="group" id="g"}
						<option {if condition="isset($user) and ($user['group_id'] eq $g['id'])"} selected="selected"{/if}  value="{$g.id}">{$g.title}</option>		
						{/volist}				
					</select>
				</div>
			</div>
			
			<div class="form-group required">
				<label class="col-sm-2 control-label">状态：</label>
				<div class="col-sm-10">
					<div class="clearfix">					
						<label class="radio-inline"><input  type="radio" value="1" name="status">开启</label>	
						<label class="radio-inline"><input  type="radio" value="0" name="status">禁用</label>				
				</div>
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-1 control-label no-padding-left"> </label>	
				<div class="col-sm-11">
					<input id="send" type="submit" value="提交" class="btn btn-primary" />
				</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="javascript"}

<script>

var back_index="{:url('User/index')}";

$('#send').click(function(){
	$.post(
		'{$action}',
		$('.form-horizontal input[type=\'text\'],.form-horizontal input[type=\'hidden\'],.form-horizontal select,.form-horizontal input[type=\'radio\']:checked'),
		function(d){
			art_dialog(d,back_index);
		}
	);
});
$(function(){
	Oscshop.setValue("status", {$user.status|default='1'});
});
</script>							
{/block}
